package com.bingfor.easycablelink.utils;

import android.app.Activity;
import android.content.Context;
import android.util.Log;

import com.bingfor.easycablelink.base.BaseActivity;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.UMShareListener;
import com.umeng.socialize.bean.SHARE_MEDIA;
import com.umeng.socialize.media.UMImage;
import com.umeng.socialize.media.UMWeb;

/**
 * Created by LY on 2017/5/27.
 */

public  class ShareUtils {


    /**
     *  QQ分享
     * @param mContent
     * @param url
     * @param umShareListener
     */
    public static void QqShare(final Activity mContent, String url,UMShareListener umShareListener){

        UMImage image = new UMImage(mContent, "http://182.92.161.212/kitchenpie-php/icon_512.png");//网络图片
        UMWeb web = new UMWeb(url);
        new ShareAction(mContent)
                .setPlatform(SHARE_MEDIA.QQ)
                .withText("http://182.92.161.212/dld.html")
                .withMedia(web)
                .setCallback(umShareListener).share();
    }

    public static void QqZoneShare(final Activity mContent, String url,UMShareListener umShareListener){

        UMImage image = new UMImage(mContent, "http://182.92.161.212/kitchenpie-php/icon_512.png");//网络图片
        UMWeb web = new UMWeb(url);
        new ShareAction(mContent)
                .setPlatform(SHARE_MEDIA.QZONE)
                .withText("http://182.92.161.212/dld.html")
                .withMedia(web)
                .setCallback(umShareListener).share();
    }
    public static void WeixinShare(final Activity mContent, String url,UMShareListener umShareListener){

        UMImage image = new UMImage(mContent, "http://182.92.161.212/kitchenpie-php/icon_512.png");//网络图片
        UMWeb web = new UMWeb(url);
        new ShareAction(mContent)
                .setPlatform(SHARE_MEDIA.WEIXIN)
                .withText("http://182.92.161.212/dld.html")
                .withMedia(web)
                .setCallback(umShareListener).share();
    }
    public static void WeixinCircleShare(final Activity mContent, String url,UMShareListener umShareListener){

        UMImage image = new UMImage(mContent, "http://182.92.161.212/kitchenpie-php/icon_512.png");//网络图片
        UMWeb web = new UMWeb(url);
        new ShareAction(mContent)
                .setPlatform(SHARE_MEDIA.WEIXIN_CIRCLE)
                .withText("http://182.92.161.212/dld.html")
                .withMedia(web)
                .setCallback(umShareListener).share();
    }

}
